import server from "./request.js"

export const login = (data) => {
    return server({
        url: '/login',
        method: 'post',
        data: data
    })
}

export const getHistoryMessage = (from, target) => {
    return server({
        url: '/history?from=' + from + '&target=' + target,
        method: 'get'
    })
}

export const messageList = (fId) => {
    return server({
        url: '/cList?id=' + fId,
        method: 'get'
    })
}

export const getAdd = (from) => {
    return server({
        url: '/gfm?from=' + from,
        method: 'get'
    })
}

export const searchFriend = (nick) => {
    return server({
        url: '/ser?username=' + nick,
        method: 'get'
    })
}

export const sendAddMsg = (info) => {
    return server({
        url: '/sfm',
        data: info,
        method: 'post'
    })
}

export const sadd = (from, target) => {
    return server({
        url: '/add?from=' + from + '&target=' + target,
        method: 'get'
    })
}

export const unadd = (from, target) => {
    return server({
        url: '/unadd?from=' + from + '&target=' + target,
        method: 'get'
    })
}

export const getFriendList = (from) => {
    return server({
        url: '/gfl?from=' + from,
        method: 'get'
    })
}

export const AckMessage = (from, target) => {
    return server({
        url: '/ack?from=' + from + '&target=' + target,
        method: 'put'
    })
}



